package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.CurrStatusPeopleDao;
import cn.topevery.garden.entity.po.CurrStatusPeople;
import cn.topevery.garden.entity.query.CurrStatusPeopleQuery;
import cn.topevery.garden.entity.vo.CurrStatusPeopleVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author code-generate
 * @date 2021-09-01
 */
@Service
public class CurrStatusPeopleLogic extends BaseLogic<CurrStatusPeople> {
    @Autowired
    CurrStatusPeopleDao currStatusPeopleDao;

    @Override
    public BaseEntityDao<CurrStatusPeople, Integer> getDao() {
        return currStatusPeopleDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<CurrStatusPeopleVO> listPage(CurrStatusPeopleQuery query) {
        return currStatusPeopleDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        currStatusPeopleDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param currStatusPeople 实体
     */
    public void saveOrUpdate(String userId, CurrStatusPeople currStatusPeople){
        currStatusPeopleDao.saveOrUpdate(userId,currStatusPeople);
    }

    public void currStatusRest(){
        currStatusPeopleDao.currStatusRest();
    }

    public Boolean uptOnlineStatus(){
        return currStatusPeopleDao.uptOnlineStatus();
    }
}
